<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
<script>
    function mergeAndUnique(arr,brr){
        var crr=arr.concat(brr)
        var drr=[]
        for(i=0;i<=crr.length;i++){
            if(drr.indexOf(crr[i])==-1){
                drr.push(crr[i])
            }
        }
        document.write(drr)
    }
    mergeAndUnique([1,4,6,5,8],[1,5,7])
</script>